<template>
  <div>
    <el-popconfirm
      confirm-button-text='确定'
      cancel-button-text='取消'
      icon="el-icon-info"
      icon-color="red"
      title="确定要退出登录吗？"
      @confirm="out"
    >
      <el-button slot="reference" type="text" style="color: #F56C6C">
        <i class="el-icon-switch-button"></i>退出登录
      </el-button>
    </el-popconfirm>
  </div>
</template>

<script>
export default {
  name: "logout",
  methods: {
    out() {
      sessionStorage.clear()
      this.$router.push('/login')
    }
  }
}
</script>